package com.deram.ctin.serv.enter.api;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.enter.entity.BaseUpdateInfo;
import com.deram.ctin.serv.enter.entity.EnterInfo;
import com.deram.ctin.serv.enter.entity.EnterMainUser;
import com.deram.ctin.serv.enter.filter.EnterMainUserFilter;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/13 11:29
 * @version: V1.0
 */
@FeignClient("serv-enter")
@RequestMapping("/enterMainUserApi")
public interface EnterMainUserApi {

    @PostMapping("/list")
    List<EnterMainUser> list(@RequestBody EnterMainUserFilter filter);

    @PostMapping("/searchByCode")
    List<EnterInfo> searchByCode(@RequestBody EnterMainUserFilter filter);

    @PostMapping("/findByEnterInfo")
    List<EnterMainUser> findByEnterInfo(@RequestParam("id") Long id);

    @PostMapping("/save")
    EnterMainUser save(@RequestBody EnterMainUser param);

    @PostMapping("/delete")
    void delete(@RequestParam("id") Long id);

    @PostMapping("/search")
    PageResult<EnterMainUser> search(@RequestBody EnterMainUserFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);

    /**
     * saveList 会先删除以前的 然后保存上传的
     * @param updateInfo
     */
    @PostMapping("/saveList")
    void saveList(@RequestBody BaseUpdateInfo<EnterMainUser> updateInfo);
}
